/*
 * web.js
 * Copyright (C) 2015 hzsunshx <hzsunshx@onlinegame-13-180>
 *
 * Distributed under terms of the MIT license.
 */
var express = require("express");
var app = express();

app.set('port', (process.env.PORT || 7411))
app.use("/public", express.static(__dirname + '/public'));

app.get('/', function(req, res){
	var goto = req.param("goto");
	if (goto){
		res.redirect(302, goto);
	}
	res.sendfile("index.html", {root: 'public'});
});

var server = app.listen(app.get('port'), function(){
	console.log("Listen on port %d", server.address().port);
});
